package com.fire.control.system.entity;

import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.fire.control.system.statics.Type_MsgScope;


/**
* @ClassName: MessagePushSet
* @Description: TODO(消息推送设置)
* @author wanbo
* @date 2017年6月19日 下午5:38:03
*/
@Entity
@Table(name = "t_warning_message_set")
public class MessagePushSet extends BaseEntity{
	
	private static final long serialVersionUID = 7283600351053097062L;
	
	@Column
	@Enumerated(EnumType.STRING)
	private Type_MsgScope msgScopeType;
	@Column
	private boolean sendApp;
	@Column
	private boolean sendSms;
	@Column
	private boolean sendDeviceAddress;
	@Column
	private boolean sendWarningType;
	
	@Transient
	private String warningTypeName;
	
	@Column
	private String warningType;
	
	@JsonManagedReference
	@ManyToOne(cascade={CascadeType.REFRESH},fetch=FetchType.EAGER,optional=false)  
	@JoinColumn(name="company_id")  
	private Company company;
	
	//发送对象，选择角色
	@ManyToMany(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY) 
//	@JoinTable(name="t_warning_message_role",joinColumns=@JoinColumn(name="role_id"),inverseJoinColumns=@JoinColumn(name="warning_msg_id"))
	@JoinTable(name="t_warning_message_role",joinColumns=@JoinColumn(name="warning_msg_id"),inverseJoinColumns=@JoinColumn(name="role_id"))
	private Collection<Role> Roles;
	
	
	
	
	
	
	public Type_MsgScope getMsgScopeType() {
		return msgScopeType;
	}
	public void setMsgScopeType(Type_MsgScope msgScopeType) {
		this.msgScopeType = msgScopeType;
	}
	public boolean isSendApp() {
		return sendApp;
	}
	public void setSendApp(boolean sendApp) {
		this.sendApp = sendApp;
	}
	public boolean isSendSms() {
		return sendSms;
	}
	public void setSendSms(boolean sendSms) {
		this.sendSms = sendSms;
	}
	public boolean isSendDeviceAddress() {
		return sendDeviceAddress;
	}
	public void setSendDeviceAddress(boolean sendDeviceAddress) {
		this.sendDeviceAddress = sendDeviceAddress;
	}
	public boolean isSendWarningType() {
		return sendWarningType;
	}
	public void setSendWarningType(boolean sendWarningType) {
		this.sendWarningType = sendWarningType;
	}
	public Company getCompany() {
		return company;
	}
	public void setCompany(Company company) {
		this.company = company;
	}
	
	public String getWarningTypeName() {
		return warningTypeName;
	}
	public void setWarningTypeName(String warningTypeName) {
		this.warningTypeName = warningTypeName;
	}
	public String getWarningType() {
		return warningType;
	}
	public void setWarningType(String warningType) {
		this.warningType = warningType;
	}
	public Collection<Role> getRoles() {
		return Roles;
	}
	public void setRoles(Collection<Role> roles) {
		Roles = roles;
	}



	
}
